package com.jrx.anytxn.param.enums;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 |String|字符串|abc||
 |Integer|整型|22||
 |Long|长整型|98172122132||
 |Double|小数浮点|32.212||
 |Currency|金额|32.212|保留小数位2位或3位|
 |Boolean|布尔型|true,false||
 |Date|日期|日期格式的格式化信息可按照字段格式进行格式化|格式化日期|
 |Timestamp|时间戳|1970年1月1日的相对时间毫秒数|相对时间|
 |Map|k,v结构|{"k","v"}|java中的map,和一个json中的key,value数据对|
 |Dict|字典类型|字典中的值保存在字段定义的词典数据项中||
 |Enum|枚举类型|枚举类型是有限固定值||
 |List|列表类型|["abc","bcd"],||
 * 值类型 枚举
 * @author 
 */
public enum ValueType {

    STRING(0, "字符串",String.class),
    INTEGER(1, "整数",Integer.class),
    BOOLEAN(2, "布尔",Boolean.class),
    LONG(3, "长整数",Long.class),
    DATE(4, "日期",Date.class),
    DOUBLE(5, "浮点数",Double.class),
    CURRENCY(6, "金额",BigDecimal.class),
    DICTIONARY(7, "字典",List.class),
    TIMESTAMP(8,"时间戳", Timestamp.class),
    MAPS(9,"对象",Map.class),
    LISTS(10,"列表",List.class),
   LISTITEM (11, "对象列表", List.class);


    private Class clazz;

    private Integer id;

    private String description;

    ValueType(Integer id, String description, Class clazz){
        this.id=id;
        this.description=description;
        this.clazz = clazz;
    }

    public Class getValueClazz() {
        return clazz;
    }

    public Integer getId() {
        return id;
    }


    public String getDescription() {
        return description;
    }
}
